<template>
    <el-dropdown @command="$emit('command',$event)">
        <span class="el-dropdown-link">
            {{title}}
            <i class="el-icon-arrow-down el-icon--right" />
        </span>
        <el-dropdown-menu slot="dropdown">
            <el-dropdown-item v-for="(item ,i) in items" :command="item.key" :key="i">{{item.label}}</el-dropdown-item>
        </el-dropdown-menu>
    </el-dropdown>
</template>

<script>
export default {
    name: 'GDropdown',
    props: {
        title: {
            type: String,
            required: true
        },
        items: {
            type: Array,
            required: true
        }
    }
};
</script>

<style lang="scss" scoped>
</style>